package com.ssy.lingxi.report.repository.report;

import com.ssy.lingxi.report.entity.report.MobileCommonlyUsedAppDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 手机端常用App类
 * @author 伍将
 * @date 2021/3/2
 * @version 2.0.0
 */
public interface MobileCommonlyUsedAppRepository extends JpaRepository<MobileCommonlyUsedAppDO, Long>, JpaSpecificationExecutor<MobileCommonlyUsedAppDO> {

    /**
     * 根据会员id与会员角色id查询常用App
     * @author 伍将
     * @date 2021/3/2
     * @param memberId: 会员id
     * @param roleId: 会员角色id
     * @return 常用App
     **/
    List<MobileCommonlyUsedAppDO> findByMemberIdAndRoleIdOrderBySort(Long memberId, Long roleId);

    /**
     * 根据会员id与会员角色id删除常用App
     * @author 伍将
     * @date 2021/3/2
     * @param memberId:
     * @param roleId:
     * @return:
     **/
    void deleteByMemberIdAndRoleId(Long memberId, Long roleId);
}
